<template>
	<view class="caseUp  content bgf8">
		<view class="formBase" style="padding-bottom: 40rpx;">
			<view class="inpBox">
				<input type="text" maxlength="25" class="input allInp" :value="title" @input="inputChange" data-i="title" placeholder="案件名称" /></view>
			<view class="inpBox">
				<view class="label" @tap="toggleTab">{{class3?class3.name:'案件分类'}}</view>
				<image class="arrow" src="../../static/img/arrow.png" mode=""></image>
			</view>
			<view class="inpBox">
				<view class="label" @tap="mapChage">{{address||'地图位置标注'}}</view>
				<image class="arrow" src="../../static/img/arrow.png" mode=""></image>
			</view>
			<view class="inpBox h300">
				<textarea class="txa" maxlength="-1" :value="content" data-i="content" @input="inputChange" placeholder-style="color:#cccccc" placeholder="请输入案件描述" />
			</view>

			<view class="inpBox">
				<radio-group @change="radioChange">
					<label class="rid" v-for="(item, index) in items">
                        <radio :value="item.value" :checked="item.value == typeId" />
                  {{item.name}}
                </label>
				</radio-group>
			</view>

			<template v-if="typeId">
				<!--<template v-if="typeId==1">-->
					<view class="imgUp">
						<div class="imgbox" v-for="(item,ind) in imgArr">
							<image class="i" v-if="typeId==1" mode="widthFix" :src="item"></image>
							<image class="i" v-if="typeId==2" mode="widthFix" src="../../static/img/video.png"></image>
							<image class="i" v-if="typeId==3" mode="widthFix" src="../../static/img/attr.png"></image>
							<uni-icons class="del" type="clear" size="30" @click="delImg(ind)"></uni-icons>
						</div>
						<div class="imgbox up" @tap="choseImg">
							<uni-icons class="icon" type="plusempty" size="70"></uni-icons>
						</div>
					</view>
			<!--	</template>-->
				<!--<template v-else>
					<view class="imgUp">
						<div class="imgbox up" @tap="choseImg">
							<uni-icons class="icon" type="plusempty" size="70"></uni-icons>
						</div>
					</view>
					<view class="fileBox" v-for="(item,ind) in imgArr">
						<view class="label">{{item}}</view>
						<uni-icons class="del" type="clear" size="26" @click="delImg(ind)"></uni-icons>
					</view>
				</template>-->
			</template>
			<button class="allBtn btnM" @tap="subMit" :disabled="isDis">{{isDis?'上传中...':'提交案件'}}</button>
		</view>
		<uni-popup ref="popup" type="bottom">
			<view class="popup">
				<view class="picker-btn">
					<view class="left" @click="cancel">取消</view>
					<view class="right" @click="confirm">确定</view>
				</view>
				<picker-view :indicator-style="indicatorStyle" :value="valueArr" @change="bindChange">
					<picker-view-column>
						<view class="item" v-for="(item, index) in province" :key="index">{{ item.name }}</view>
					</picker-view-column>
					<picker-view-column v-if="province[valueArr[0]]">
						<view class="item" v-for="(item, index) in province[valueArr[0]].children" :key="index">{{ item.name }}</view>
					</picker-view-column>
					<picker-view-column v-if="province[valueArr[0]]">
						<view class="item" v-for="(item, index) in province[valueArr[0]].children[valueArr[1]].children" :key="index">{{ item.name }}</view>
					</picker-view-column>
				</picker-view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import caseUp from './caseUp.js';
	export default caseUp;
</script>

<style lang="scss">
	.caseUp {
		padding-top: 1rpx;
	}
	
	.popup {
		height: fit-content;
		width: 100%;
		background: #fff;
	}
	
	.picker-btn {
		display: flex;
		height: 100upx;
		width: 100%;
		line-height: 100upx;
		background: #fff;
		font-size: 34upx;
		z-index: 1;
		border-bottom: 1rpx solid #f8f8f8;
		.left {
			flex: 1;
			color: #0076ff;
			padding-left: 40upx;
			box-sizing: border-box;
		}
		.right {
			flex: 1;
			text-align: right;
			padding-right: 40upx;
			color: #fe4533;
			box-sizing: border-box;
		}
	}
	
	picker-view {
		width: 100%;
		height: 500rpx;
		display: relative;
	}
	
	.item {
		line-height: 100rpx;
		text-align: center;
	}
</style>